#include "cmainmenu.h"

CMainMenu::CMainMenu(QWidget *parent)
	: QWidget(parent)
	, ui(new Ui::CMainMenuClass())
{
	ui->setupUi(this);
	_pic2pdfWgt = new CPicToPdfWgt(nullptr);
	_pic2pdfWgt->setWindowFlags(_pic2pdfWgt->windowFlags() | Qt::Dialog);
	initstyle();
	initConnect();
}

CMainMenu::~CMainMenu()
{
	delete ui;
	_pic2pdfWgt->deleteLater(); _pic2pdfWgt = nullptr;
}

void CMainMenu::initstyle()
{
}

void CMainMenu::initConnect()
{
	connect(ui->pushButton, &QPushButton::clicked, this, &CMainMenu::showPicToPdfWgt);
}

void CMainMenu::showPicToPdfWgt()
{
	close();
	_pic2pdfWgt->show();
	_pic2pdfWgt->activateWindow();
}
